package com.xiaoxu.intranetweb.mybatisplusSzappdb.controller.ashGate;


import com.alibaba.fastjson.JSONObject;
import com.xiaoxu.intranetweb.mybatisplusSzappdb.entity.TCoalYardArea;
import com.xiaoxu.intranetweb.mybatisplusSzappdb.service.impl.TAshgateHghtRecordServiceImpl;
import com.xiaoxu.intranetweb.mybatisplusSzappdb.service.impl.TCoalYardAreaServiceImpl;
import com.xiaoxu.intranetweb.util.PermissionCheck;
import com.xiaoxu.intranetweb.util.SzResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lvNuo
 * @since 2025-04-21
 */
@RestController
@RequestMapping("/coalYardArea")
public class TCoalYardAreaController {
    @Autowired
    private TCoalYardAreaServiceImpl coalYardAreaService;

    @GetMapping("/getCoalYardArea")
    public SzResult getList(
            @RequestParam(value = "page", required = false) Integer page,
            @RequestParam(value = "pageSize", required = false) Integer pageSize,
            @RequestParam(value = "ashGateId", required = false) String ashGateId){
        return SzResult.success(coalYardAreaService.getList(page, pageSize,ashGateId));
    }
//    @GetMapping("/getAshGateBindCoalList")
//    public SzResult getAshGateBindCoalList(){
//        return coalYardAreaService.getAshGateBindCoalList();
//    }
    @PostMapping("/addCoalYardArea")
    public SzResult addCoalYardArea(@RequestBody TCoalYardArea coalYardArea) {
        return coalYardAreaService.addCoalYardArea(coalYardArea);
    }
    @PostMapping("/updateCoalYardArea")
    public SzResult updateCoalYardArea(@RequestBody TCoalYardArea coalYardArea) {
        return coalYardAreaService.updateCoalYardArea(coalYardArea);
    }
    @GetMapping("/delCoalYardArea")
    public SzResult delCoalYardArea(
            @RequestParam(value = "id", required = false) String id){
        return coalYardAreaService.delCoalYardArea(id);
    }
}
